﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace GAIA_IU
{
    public partial class Login : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }

        protected void btn_login_Click(object sender, EventArgs e)
        {
            string pwd = "RB2013";
            if (txt_pwd.Text == pwd)
            {
                Session["login"] = true;
                Response.Redirect("act_clientes.aspx");
            }
            else {
                Avisar("La clave es incorrecta", false);
                Session["login"] = false;
            }
        }

        protected void Avisar(string aviso, bool resultado)
        {
            this.aviso_label.Text = aviso;
            if (resultado)
            {
                this.aviso_label.CssClass = "_true";
            }
            else
            {
                this.aviso_label.CssClass = "_false";
            }

        }
    }
}